home *** CD-ROM | disk | FTP | other *** search
/ Diccionario Visual Trilingue / VISUAL.iso / SHARED.DIR / 10003_P_Language Frame Script.ls < prev    next >
Encoding:
Text File  |  1997-07-04  |  5.8 KB  |  229 lines

  1. global gTextLanguage, gSoundLevel, gOldTextLanguage, gIndexChange, gContenuChange, gHighLightPos, gHighLightPosC, gFlushDialogEvent, gReturnDialog
  2.  
  3. on exitFrame
  4.   go(the frame)
  5. end
  6.  
  7. on keyDown
  8.   if the key = " " then
  9.     if not (soundBusy(0) or soundBusy(1)) then
  10.       beep()
  11.     end if
  12.   end if
  13.   if the machineType = 256 then
  14.     keyDown_PC()
  15.   else
  16.     keyDown_MAC()
  17.   end if
  18. end
  19.  
  20. on mouseDown
  21.   repeat while the mouseDown
  22.     nothing()
  23.   end repeat
  24.   ResetLanguagePaletteButtons()
  25. end
  26.  
  27. on keyDown_PC
  28.   set SpriteNums to [22, 21, 23, 26, 25, 27]
  29.   set CastNames to ["I.ac.", "I.ac.", "I.ac.", "T.ac.", "T.ac.", "T.ac."]
  30.   if (the keyCode = 48) and the shiftDown then
  31.     repeat with i = 1 to 6
  32.       set SpriteNo to getAt(SpriteNums, i)
  33.       set CastNo to the castNum of sprite SpriteNo
  34.       if the name of cast CastNo starts getAt(CastNames, i) then
  35.         set TempNum to the castNum of sprite SpriteNo - 1
  36.         set the castNum of sprite SpriteNo to TempNum
  37.         if i = 1 then
  38.           set the visible of sprite 30 to 0
  39.           set the visible of sprite 39 to 1
  40.         else
  41.           set TempNum to the castNum of sprite getAt(SpriteNums, i - 1) + 1
  42.           set the castNum of sprite getAt(SpriteNums, i - 1) to TempNum
  43.         end if
  44.         updateStage()
  45.         return 
  46.       end if
  47.     end repeat
  48.     if the visible of sprite 39 then
  49.       set the visible of sprite 39 to 0
  50.       set the visible of sprite 30 to 1
  51.       return 
  52.     end if
  53.     if the visible of sprite 30 then
  54.       set the visible of sprite 30 to 0
  55.       set TempNum to the castNum of sprite getAt(SpriteNums, 6) + 1
  56.       set the castNum of sprite getAt(SpriteNums, 6) to TempNum
  57.     end if
  58.     updateStage()
  59.     return 
  60.   end if
  61.   if the keyCode = 48 then
  62.     repeat with i = 1 to 6
  63.       set SpriteNo to getAt(SpriteNums, i)
  64.       set CastNo to the castNum of sprite SpriteNo
  65.       if the name of cast CastNo starts getAt(CastNames, i) then
  66.         set TempNum to the castNum of sprite SpriteNo - 1
  67.         set the castNum of sprite SpriteNo to TempNum
  68.         if i = 6 then
  69.           set the visible of sprite 39 to 0
  70.           set the visible of sprite 30 to 1
  71.         else
  72.           set TempNum to the castNum of sprite getAt(SpriteNums, i + 1) + 1
  73.           set the castNum of sprite getAt(SpriteNums, i + 1) to TempNum
  74.         end if
  75.         return 
  76.       end if
  77.     end repeat
  78.     if the visible of sprite 30 then
  79.       set the visible of sprite 30 to 0
  80.       set the visible of sprite 39 to 1
  81.       return 
  82.     end if
  83.     if the visible of sprite 39 then
  84.       set the visible of sprite 39 to 0
  85.       set TempNum to the castNum of sprite getAt(SpriteNums, 1) + 1
  86.       set the castNum of sprite getAt(SpriteNums, 1) to TempNum
  87.     end if
  88.     updateStage()
  89.     return 
  90.   end if
  91.   if (the key = ENTER) or (the key = RETURN) then
  92.     repeat with i = 1 to 3
  93.       set SpriteNo to getAt(SpriteNums, i)
  94.       set CastNo to the castNum of sprite SpriteNo
  95.       if the name of cast CastNo starts getAt(CastNames, i) then
  96.         InterfaceChange(i)
  97.         return 
  98.       end if
  99.     end repeat
  100.     repeat with i = 4 to 6
  101.       set SpriteNo to getAt(SpriteNums, i)
  102.       set CastNo to the castNum of sprite SpriteNo
  103.       if the name of cast CastNo starts getAt(CastNames, i) then
  104.         TextChange(i - 3)
  105.         return 
  106.       end if
  107.     end repeat
  108.     if the visible of sprite 30 then
  109.       if gReturnDialog = #HISTORY then
  110.         set gFlushDialogEvent to 1
  111.       end if
  112.       flashButton(31)
  113.       CancelLanguagePalette()
  114.       dontPassEvent()
  115.       abort()
  116.     end if
  117.     if the visible of sprite 39 then
  118.       flashButton(40)
  119.       if gReturnDialog = #HISTORY then
  120.         set gFlushDialogEvent to 1
  121.       end if
  122.       if not (gTextLanguage = gOldTextLanguage) then
  123.         set gIndexChange to 1
  124.         set gContenuChange to 1
  125.       end if
  126.       CloseLangPrefPalettes()
  127.       dontPassEvent()
  128.       abort()
  129.     end if
  130.   end if
  131.   if the controlDown then
  132.     if the optionDown then
  133.       if the key = "1" then
  134.         InterfaceChange(1)
  135.       else
  136.         if the key = "2" then
  137.           InterfaceChange(2)
  138.         else
  139.           if the key = "3" then
  140.             InterfaceChange(3)
  141.           end if
  142.         end if
  143.       end if
  144.     else
  145.       if the key = "1" then
  146.         TextChange(1)
  147.       else
  148.         if the key = "2" then
  149.           TextChange(2)
  150.         else
  151.           if the key = "3" then
  152.             TextChange(3)
  153.           end if
  154.         end if
  155.       end if
  156.     end if
  157.   end if
  158.   if the keyCode = 53 then
  159.     flashButton(31)
  160.     CancelLanguagePalette()
  161.   end if
  162.   if the keyCode = 123 then
  163.     set gSoundLevel to gSoundLevel - 1
  164.     if gSoundLevel < 0 then
  165.       set gSoundLevel to 0
  166.     end if
  167.     setSound()
  168.     beep()
  169.     updateStage()
  170.     ResetLanguagePaletteButtons()
  171.     return 
  172.   end if
  173.   if the keyCode = 124 then
  174.     set gSoundLevel to gSoundLevel + 1
  175.     if gSoundLevel > 7 then
  176.       set gSoundLevel to 7
  177.     end if
  178.     setSound()
  179.     beep()
  180.     ResetLanguagePaletteButtons()
  181.     updateStage()
  182.     return 
  183.   end if
  184. end
  185.  
  186. on keyDown_MAC
  187.   if the optionDown then
  188.     if the key = "┬í" then
  189.       InterfaceChange(1)
  190.     else
  191.       if the key = "Γäó" then
  192.         InterfaceChange(2)
  193.       else
  194.         if the key = "┬ú" then
  195.           InterfaceChange(3)
  196.         end if
  197.       end if
  198.     end if
  199.   else
  200.     if the key = "1" then
  201.       TextChange(1)
  202.     else
  203.       if the key = "2" then
  204.         TextChange(2)
  205.       else
  206.         if the key = "3" then
  207.           TextChange(3)
  208.         else
  209.           if the key = "." then
  210.             flashButton(31)
  211.             CancelLanguagePalette()
  212.           end if
  213.         end if
  214.       end if
  215.     end if
  216.   end if
  217.   if (the key = ENTER) or (the key = RETURN) then
  218.     if gReturnDialog = #HISTORY then
  219.       set gFlushDialogEvent to 1
  220.     end if
  221.     flashButton(40)
  222.     if not (gTextLanguage = gOldTextLanguage) then
  223.       set gIndexChange to 1
  224.       set gContenuChange to 1
  225.     end if
  226.     CloseLangPrefPalettes()
  227.   end if
  228. end
  229.